Rewriting declarative query languages

نویسنده

  • Matthias Brantner
چکیده

Queries against databases are formulated in declarative languages. Examples are the relational query language SQL and XPath or XQuery for querying data stored in XML. Using a declarative query language, the querist does not need to know about or decide on anything about the actual strategy a system uses to answer the query. Instead, the system can freely choose among the algorithms it employs to answer a query. Predominantly, query processing in the relational context is accomplished using a relational algebra. To this end, the query is translated into a logical algebra. The algebra consists of logical operators which facilitate the application of various optimization techniques. For example, logical algebra expressions can be rewritten in order to yield more efficient expressions. In order to query XML data, XPath and XQuery have been developed. Both are declarative query languages and, hence, can benefit from powerful optimizations. For instance, they could be evaluated using an algebraic framework. However, in general, the existing approaches are not directly utilizable for XML query processing. This thesis has two goals. The first goal is to overcome the above-mentioned misfits of XML query processing, making it ready for industrial-strength settings. Specifically, we develop an algebraic framework that is designed for the efficient evaluation of XPath and XQuery. To this end, we define an order-aware logical algebra and a translation of XPath into this algebra. Furthermore, based on the resulting algebraic expressions, we present rewrites in order to speed up the execution of such queries. The second goal is to investigate rewriting techniques in the relational context. To this end, we present rewrites based on algebraic equivalences that unnest nested SQL queries with disjunctions. Specifically, we present equivalences for unnesting algebraic expressions with bypass operators to handle disjunctive linking and correlation. Our approach can be applied to quantified table subqueries as well as scalar subqueries. For all our results, we present experiments that demonstrate the effectiveness of the developed approaches.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

An Extended Relational Algebra for Declarative Programming

Relational algebra is a well-known formalism for expressing queries against a relational database. In this paper we will present a relational algebra for declarative languages. It is based in the use of the operators of projection, selection, renaming, cross product, union and join. This relational algebra can be used for dening predicates and functions for a declarative language, and in genera...

متن کامل

Types for Web Rule Languages: a preliminary study

We survey and analyse the relevant existing work on typing of rules, in particular on typing of constraint logic programs and discuss applicability of these approaches to the REWERSE reasoning and query languages under development by WG I1 and by WG I4. This is related to WG I1, developing logic programming like languages for reasoning on the web and with WG I4 investigating development of decl...

متن کامل

Classification And Optimization of Nested Queries in Object Bases

Many declarative query languages for object-oriented (oo) databases allow nested subqueries. This paper contains a complete classiication of oo nested queries and appropriate unnesting optimization strategies based on algebraic rewriting. We adapt some known relational techniques and introduce new ones that use and are concerned with features speciic to object-oriented queries. In particular, w...

متن کامل

From Nested-Loop to Join Queries in OODB

Most declarative SQL-like query languages for object-oriented database systems (OOSQL) are orthogonal languages allowing for arbitrary nesting of expressions in the select-, from-, and where-clause. Expressions in the from-clause may be base tables as well as setvalued attributes. In this paper, we propose a general strategy for the optimization of nested OOSQL queries. As in the relational mod...

متن کامل

Defining Datalog in Rewriting Logic

In recent work, the effectiveness of using declarative languages has been demonstrated for many problems in program analysis. Using a simple relational query language, like Datalog, complex interprocedural analyses involving dynamically created objects can be expressed in just a few lines. By exploiting the power of the Rewriting Logic language Maude, we aim at transforming Datalog programs int...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007